<template>
	<view class="container">
		<!-- #ifdef H5 -->
		<uni-header></uni-header>
		<!-- #endif -->

		<view class="bid-box com-box">
			<view class="bid-list">
				<view class="bid-item">
					<text class="title">{{bidList.tbPublishingNeeds.goodsName}}</text>
					<text class="num">数量：{{bidList.tbPublishingNeeds.num}}</text>
					<text class="size">规格：{{bidList.tbPublishingNeeds.specifications}}</text>
					<view class="text-wrapper">
						<view class="shop clamp">
							<image :src="bidList.tbPublishingNeeds.imgUrl" mode="scaleToFill"></image>
							{{bidList.tbPublishingNeeds.userName}}
						</view>
						<view class="time">
							<text>截止时间：{{$util.sliceTime(bidList.tbPublishingNeeds.effectiveTime)}}</text>
							<text>送达时间：{{$util.sliceTime(bidList.tbPublishingNeeds.sendTime)}}</text>
						</view>
					</view>

					<text class="text">成交价格：¥{{bidList.dealPrice}}</text>
					<text class="text">联系方式：{{bidList.tbPublishingNeeds.phone}}</text>
					<text class="text">需求地址：{{bidList.tbPublishingNeeds.sendAddress}}</text>
				</view>
			</view>

			<view class="detail-desc">
				<view class="d-header">
					<text class="d-ttl">中标公司</text>
				</view>
				<view class="d-inner">
					<image :src="bidList.tbSeller.logoPic" mode="scaleToFill"></image>
					<view class="d-txt">
						<text>{{bidList.tbSeller.sellerName}}</text>
						<text>出价：¥{{bidList.dealPrice}}</text>
						<!-- <text>定金：¥{{bidList.bidPrice}}</text> -->
					</view>
				</view>
			</view>

			<view class="detail-desc">
				<view class="d-header">
					<text class="d-ttl">公司资质</text>
				</view>
				<view class="d-info">
					<text class="d-ttl">姓名</text>
					<text>{{bidList.tbSeller.name}}</text>
				</view>
				<view class="d-info">
					<text class="d-ttl">联系方式</text>
					<text>{{bidList.tbSeller.telephone}}</text>
				</view>
				<view class="d-info">
					<text class="d-ttl">公司名称</text>
					<text>{{bidList.tbSeller.sellerName}}</text>
				</view>
				<view class="d-info">
					<text class="d-ttl">法人姓名</text>
					<text>{{bidList.tbSeller.legalPerson}}</text>
				</view>
				<view class="d-info">
					<text class="d-ttl">发票信息</text>
					<text>{{bidList.tbSeller.invoiceInfo}}</text>
				</view>
			</view>

			<view class="detail-desc">
				<view class="d-header">
					<text class="d-ttl">营业执照</text>
				</view>
				<view class="d-info">
					<image :src="bidList.licensePhoto" mode="widthFix"></image>
				</view>
			</view>

			<view class="detail-desc">
				<view class="d-header">
					<text class="d-ttl">公司资质</text>
				</view>
				<view class="d-info">
					<image :src="bidList.certificationsPhoto" mode="widthFix"></image>
				</view>
			</view>
		</view>

		<!-- #ifdef H5 -->
		<uni-footer></uni-footer>
		<!-- #endif -->
	</view>
</template>

<script>
	import uniHeader from '@/components/h5/uni-header.vue'
	import uniFooter from '@/components/h5/uni-footer.vue'
	export default {
		components: {
			uniHeader,
			uniFooter
		},
		data() {
			return {
				submiting: false,
				publishingNeedsId: '',
				bidList: ''
			}
		},
		onLoad(option) {
			this.publishingNeedsId = option.id
			this.loadData()
		},
		methods: {
			loadData() {
				this.$api.request('/publishingNeeds/winningLogAllMessage', {
					id: this.publishingNeedsId
				}, {
					method: 'GET'
				}).then(res => {
					this.bidList = res.data
					console.log(this.bidList)
				})
			},
			naviageToPage(page) {
				uni.navigateTo({
					url: page
				})
			}
		}
	}
</script>

<style lang='scss'>
	page {
		padding-top: 20upx;
	}

	/* #ifdef H5 */
	@media screen and (min-width: 750px) {
		page {
			padding-top: 0;
		}

		.bid-box {
			margin: 20px auto;
		}

		.bid-list {
			.bid-item {
				margin-bottom: 20px;
			}

			.text {
				line-height: 30px;
			}
		}

	}

	/* #endif */
</style>
